<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>
<%@page import="iwpl.project.entities.Departments"%>
<%@page import="iwpl.project.dao.DepartmentsDAO"%>
<%@page import="iwpl.project.entitymanagerhelper.*"%>

<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type="text/javascript" src="js/jquery-Source.js"></script>
		<script type="text/javascript" src="js/jquery-Validation.js"></script>
		<!--<script src="http://code.jquery.com/jquery-latest.js"></script>
		<script type="text/javascript"
			src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>-->

		<title>Offices</title>
		<link href="css/CommonCSS.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
	$(document).ready(function() {
		$("#Department").validate();
	});
</script>
	</head>

	<body>
		<form class="cmxform" id="Department" method="get"
			action="./servlet/Control_Department">
			<% 
				String strID = ""; 
				strID = request.getParameter("id"); 
				DepartmentsDAO dao = new DepartmentsDAO(); 
				Departments depart = dao.findById(Integer.parseInt(strID)); 
			%>
			<fieldset>
				<legend>
					Hello
				</legend>
				<p>
					<label for="DepartmentID">
						Department ID:
					</label>
					<input id="DepartmentID" name="TxtDepartmentID" class="required" value="<%=strID%>"/>
				</p>
				<p>
					<label for="DepartmentName">
						Department Name:
					</label>
					<input id="DepartmentName" name="TxtDepartmentName" class="required" value="<%=depart.getDepartmentName()%>"/>
				</p>
				<p>
					<label for="Address">
						Address:
					</label>
					<input id="Address" name="TxtAddress" class="required" value="<%=depart.getAddress() %>"/>
				</p>
				<p>
					<label for="TotalOfFloor">
						Total Of Floor:
					</label>
					<input id="TotalOfFloor" name="TxtTotalOfFloor" class="number; required" max="10" value="<%=depart.getTotalOfFloor() %>"/>
				</p>
				<p>
					<label for="Phone">
						Phone Number:
					</label>
					<input id="Phone" name="TxtPhone" value="<%=depart.getPhone() %>"/>
				</p>
				<p>
					<input class="submit" type="submit" value="Submit" Name="BtnUpdate"/>
				</p>
			</fieldset>
		</form>
	</body>
</html>